(function() {
    seajs.use(["swipeSlide"], function (service) {
        $(function () {
            //close dialog
            $(".x,.ft-btn .btn-light").click(function () {
                $(".mask,.dialog").addClass("hide");
            });
            //get height
            var getHeight = function () {
                var w = $(window).width();
                $("#slider").css({"height": w * 150 / 375});
                $(".topic-banner").css({"height": w * 100 / 345});
            }
            getHeight();
            $(window).resize(function () {
                getHeight();
            });
            // slider
            $('#slider').swipeSlide({
                continuousScroll: true,
                speed: 3000,
                transitionType: 'cubic-bezier(0.22, 0.69, 0.72, 0.88)',
                firstCallback: function (i, sum, me) {
                    me.find('.dot').children().first().addClass('cur');
                },
                callback: function (i, sum, me) {
                    me.find('.dot').children().eq(i).addClass('cur').siblings().removeClass('cur');
                }
            });
        });
    });
})();
